package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzBorrowDetailMapper;
import com.ruoyi.system.domain.HmzBorrowDetail;
import com.ruoyi.system.service.IHmzBorrowDetailService;

/**
 * 领用单子Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-30
 */
@Service
public class HmzBorrowDetailServiceImpl implements IHmzBorrowDetailService
{
    @Autowired
    private HmzBorrowDetailMapper hmzBorrowDetailMapper;

    /**
     * 查询领用单子
     *
     * @param id 领用单子主键
     * @return 领用单子
     */
    @Override
    public HmzBorrowDetail selectHmzBorrowDetailById(Long id)
    {
        return hmzBorrowDetailMapper.selectHmzBorrowDetailById(id);
    }
    /**
     * 查询领用单子
     *
     * @param rfidCode 领用单子rfid
     * @return 领用单子
     */
    public List<Integer> selectHmzBorrowDetailByRfidCode(String rfidCode){
        return hmzBorrowDetailMapper.selectHmzBorrowDetailByRfidCode(rfidCode);
    }
    /**
     * 查询领用单子
     *
     * @param hmzBorrowDetail remark 领用单子rfid和备注
     * @return 领用单子
     */
    public HmzBorrowDetail selectHmzBorrowDetailByRfidCodeAndRemark(HmzBorrowDetail hmzBorrowDetail){
        return hmzBorrowDetailMapper.selectHmzBorrowDetailByRfidCodeAndRemark(hmzBorrowDetail);
    }
    /**
     * 查询领用单子列表
     *
     * @param hmzBorrowDetail 领用单子
     * @return 领用单子
     */
    @Override
    public List<HmzBorrowDetail> selectHmzBorrowDetailList(HmzBorrowDetail hmzBorrowDetail)
    {
        return hmzBorrowDetailMapper.selectHmzBorrowDetailList(hmzBorrowDetail);
    }

    /**
     * 新增领用单子
     *
     * @param hmzBorrowDetail 领用单子
     * @return 结果
     */
    @Override
    public int insertHmzBorrowDetail(HmzBorrowDetail hmzBorrowDetail)
    {
        hmzBorrowDetail.setCreateTime(DateUtils.getNowDate());
        return hmzBorrowDetailMapper.insertHmzBorrowDetail(hmzBorrowDetail);
    }

    /**
     * 修改领用单子
     *
     * @param hmzBorrowDetail 领用单子
     * @return 结果
     */
    @Override
    public int updateHmzBorrowDetail(HmzBorrowDetail hmzBorrowDetail)
    {
        hmzBorrowDetail.setUpdateTime(DateUtils.getNowDate());
        return hmzBorrowDetailMapper.updateHmzBorrowDetail(hmzBorrowDetail);
    }

    /**
     * 批量删除领用单子
     *
     * @param ids 需要删除的领用单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzBorrowDetailByIds(Long[] ids)
    {
        return hmzBorrowDetailMapper.deleteHmzBorrowDetailByIds(ids);
    }

    /**
     * 删除领用单子信息
     *
     * @param id 领用单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzBorrowDetailById(Long id)
    {
        return hmzBorrowDetailMapper.deleteHmzBorrowDetailById(id);
    }
}
